
/*
 * @Description: 历史告警记录
 */
import request from '@/utils/request'
export default {
    /**
     * @description: 获取告警信息表格 *代表必填
     * @param {String/Number} page *
     * @param {String/Number} size *
     */
    getlist(params, isdis = true) {
        return request.post("v3/alarm/alarmMessage/queryPageList", {
            page: params.page,
            size: params.size,
            sortList: params.sortList || [],
            entity: {
                ...params.entity,
                organizationNo: sessionStorage.getItem("organizationNo"),
                farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
                system: "SC",
                disposeStatus: isdis
            }
        });
    },
    /**
     * @description: 添加
     * @param {Object}  *
     */
    add(params) {
        return request.post('v3/alarm/alarmMessage/add', {
            ...params,
            organizationNo: sessionStorage.getItem("organizationNo"),
            "system": "SC"
        });
    },
    /**
     * @description: 批量删除
     * @param {Object}  *
     */
    dellList(params) {
        return request.post('v3/alarm/alarmMessage/delList', {
            'alarmMessageIdList': params
        });
    },
    /**
     * @description: 修改
     * @param {Object}  *
     */
    edit(params) {
        return request.post('v3/alarm/alarmMessage/edit', {
            ...params,
            "system": "SC"
        });
    },
    // 批量修改
    edilists(params) {
        return request.post('v3/alarm/alarmMessage/editList', {
            ...params,
            "system": "SC"
        })
    },
    /**
     * @description: 条件查询
     * @param {Object}  *
     */
    quertbycond(params) {
        return request.post('v3/alarm/alarmMessage/queryByCondition', {
            ...params,
            system: "SC"
        });
    },
    // /batch/queryByCondition
    /**
     * @description: 获取批次
     * @param {Object}  *
     */
    getbatchlist(params) {
        return request.post('v3/batch/productionBatch/queryByCondition', {
            "farmingTypeNo": sessionStorage.farmingTypeNo,
            organizationNo: sessionStorage.getItem("organizationNo"),
            ...params
            // org
        });
    },
    /**
     * @description: 获取可选择数据类型
     * @param {Object}  *
     */
    getdatatypelist() {
        return request.get('/dataTypeConfig/queryAllDataType');
    },
    /**
     * @description: 获取监测数据项
     * @param {Object}  *
     */
    getdataitemlist() {
        return request.post('v3/iot/dataItem/queryByCondition', {
            organizationNo: sessionStorage.getItem("organizationNo"),
            deleteFlag: false,
            control: false,
            visible: true
        });
    },
    /**
     * @description: 数值告警表格查询
     * @param {Object}  *
     */
    getDataItemtable(params) {
        return request.post('/numericalAlarmMessage/queryPageList', {
            ...params,
            entity: {
                system: "SC",
                organizationNo: sessionStorage.getItem("organizationNo"),
                farmingTypeNo: sessionStorage.getItem("farmingTypeNo") || "暂无数据"
            }
        })
    },
    /**
     * @description: 数值告警条件查询
     * @param {Object}  *
     */
    getDataItemquery(params) {
        return request.post('/numericalAlarmMessage/queryByCondition', {
            ...params,
            system: "SC",
            organizationNo: sessionStorage.getItem("organizationNo"),
            farmingTypeNo: sessionStorage.getItem("farmingTypeNo") || "暂无数据"
        })
    },
    /**
     * @description: 数值告警修改
     * @param {Object}  *
     */
    editDataItem(params) {
        return request.post('/numericalAlarmMessage/edit', {
            ...params
        })
    },
    /**
     * @description: 数据项数据变化查询
     * @param {Object}  *
     */
    getdataitemcollectquery(params) {
        return request.post('/dataCollect/queryByCondition', {
            ...params
        })
    }
};

